package com.anjie.powerproject.strategy.service;

import com.anjie.powerproject.entity.HistoryData;
import com.anjie.powerproject.repository.HistoryDataRepository;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

@Service
public class HistoryDataService {
    @Resource
    private HistoryDataRepository historyDataRepository;

    public List<HistoryData> getHistoryDataListByDateAndType(Date date, Integer type, Integer graphId) {
        return historyDataRepository.findHistoryDataByDateAndType(date, type, graphId);
    }

    public void insertAll(List<HistoryData> historyDataList) {
        historyDataRepository.saveAll(historyDataList);
    }
}